package com.bjwl.service.impl;

import com.bjwl.dao.NannyMapper;
import com.bjwl.pojo.Card;
import com.bjwl.pojo.Staff;
import com.bjwl.service.NannyService;
import com.bjwl.utils.PageBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: czc
 * @Date:Create：in 2020/5/20 15:53
 * @Description:
 * @Modified By：
 * @Version: 1.0
 */
@Service
public class NannyServiceImpl implements NannyService {

    @Autowired
    private NannyMapper nannyMapper;

    @Override
    public List<Staff> findAllNannyByBsid(Integer bsid) {
        return nannyMapper.findAllNannyByBsid(bsid);
    }

    @Override
    public Staff findNannyById(Integer id) {
        return nannyMapper.findNannyById(id);
    }

    @Override
    public PageBean<Staff> findAllNannyPage(Integer pageNum, Integer bsid ,Float nhourse) {
        PageBean<Staff> pageBean = new PageBean<Staff>(pageNum,5,nannyMapper.nannyPaging(bsid,nhourse));
        pageBean.setData(nannyMapper.findAllNannyPages(pageBean,bsid,nhourse));
        return pageBean;
    }

    @Override
    public PageBean<Staff> findAllCleaningPage(Integer pageNum, Integer bsid, String remarks) {
        PageBean<Staff> pageBean = new PageBean<Staff>(pageNum,5,nannyMapper.cleaningPaging(bsid,remarks));
        pageBean.setData(nannyMapper.findAllCleaningPages(pageBean,bsid,remarks));
        return pageBean;
    }
}
